package com.dashu.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 读取核心系统配置文件
 * Created by cuip on 2016/12/31.
 */
@RestController
public class SystemConfigController {

    @Value("${test.msg}")
    private String msg;

    @Autowired
    private Environment environment;

    @GetMapping(value = "index")
    public String index(){
        return msg;
    }

    @GetMapping("index2")
    public String index2(){
        return environment.getProperty("test.msg");
    }
}
